package com.jatosoft.accounting.webapp;

import java.io.Serializable;

import com.google.appengine.api.datastore.KeyFactory;
import com.jatosoft.poc.priceinquiry.core.domain.BaseDomain;

public class UIModel implements Serializable {

	private static final long serialVersionUID = -643614407955595212L;
	BaseDomain model;
	Boolean selected = false;
	
	public String getStringId(){
		if(model == null){
			return null;
		}
		return KeyFactory.keyToString(model.getId());
	}

	public BaseDomain getModel() {
		return model;
	}

	public void setModel(BaseDomain model) {
		this.model = model;
	}

	public Boolean getSelected() {
		return selected;
	}

	public void setSelected(Boolean selected) {
		this.selected = selected;
	}

	public UIModel(BaseDomain model, Boolean isSelected) {
		super();
		this.model = model;
		this.selected = isSelected;
	}

	public UIModel(BaseDomain model) {
		super();
		this.model = model;
	}

	public UIModel() {
		super();
	}

}
